import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import './assets/css/global.css'
//导入列表插件
import ZkTable from 'vue-table-with-tree-grid'
// 全局引入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
// 引入富文本样式
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme



// 全局注册这个插件
Vue.component('TreeTable', ZkTable)
Vue.use(ElementUI)
Vue.config.productionTip = false
 axios.defaults.baseURL='http://127.0.0.1:8888/api/private/v1'
 //请求拦截
 axios.interceptors.request.use(config=>{
   //为请求头对象添加Token验证的Authorization
   config.headers.Authorization=window.sessionStorage.getItem('token')

   
   return config
 })
Vue.prototype.$http=axios
// Vue.prototype.$message=Message

// 全局注册这个组件
Vue.use(VueQuillEditor)

// 全局注册时间过滤器
Vue.filter('dateFormate', function(dataMill){

     let dt = new Date(dataMill)
     let y=(dt.getFullYear()+'')
     let m=(dt.getMonth()+'').padStart(2,"0")
     let d=(dt.getUTCDate()+'').padStart(2,"0")
     let h=(dt.getUTCHours()+'').padStart(2,"0")
     let f=(dt.getUTCMinutes()+'').padStart(2,"0")
     let s=(dt.getUTCSeconds()+'').padStart(2,"0")
  
    return `${y}-${m}-${d}-${h}:${f}:${s}`
})
 

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
